/**
 * pharma-model - 9 janv. 2011 guillaume
 */
package org.bspv.pharma.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;

/**
 * @author guillaume
 */
@Entity
@Table(name = "ORDER_DETAIL")
public class OrderDetail implements Serializable {

    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = 6309399726526611867L;

    /**
     * Identifiant du détail de commande.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * Commande à laquelle se rapporte ce détail.
     */
    @NotNull
    @ManyToOne
    private Order order;
    /**
     * Type de fourniture commandée.
     */
    @NotNull
    @ManyToOne
    private TypeOfSupply typeOfSupply;
    /**
     * Quantité commandée.
     */
    @NotNull
    private Integer quantity;
    /**
     * Numéro de version.
     */
    @Version
    private Integer version;

    /**
     * @return the id
     */
    public final Long getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public final void setId(final Long id) {
        this.id = id;
    }

    /**
     * @return the order
     */
    public final Order getOrder() {
        return order;
    }

    /**
     * @param order
     *            the order to set
     */
    public final void setOrder(final Order order) {
        this.order = order;
    }

    /**
     * @return the typeOfSupply
     */
    public final TypeOfSupply getTypeOfSupply() {
        return typeOfSupply;
    }

    /**
     * @param typeOfSupply
     *            the typeOfSupply to set
     */
    public final void setTypeOfSupply(final TypeOfSupply typeOfSupply) {
        this.typeOfSupply = typeOfSupply;
    }

    /**
     * @return the quantity
     */
    public final Integer getQuantity() {
        return quantity;
    }

    /**
     * @param quantity
     *            the quantity to set
     */
    public final void setQuantity(final Integer quantity) {
        this.quantity = quantity;
    }

    /**
     * @return the version
     */
    public final Integer getVersion() {
        return version;
    }

    /**
     * @param version
     *            the version to set
     */
    public final void setVersion(final Integer version) {
        this.version = version;
    }

}
